<?php
include_once $_SERVER['DOCUMENT_ROOT'].'/phorm/database/core/DatabaseColumn.php';

class TextField extends DatabaseColumn
{	
	public function __construct(IDatabaseRecord &$object, $length = null, $unique = false, $defaultValue = null)
	{
		// previoulsy was using debug_backtrace()
		// but we found an issue when (we think) php was running as CGI.  The ['object']
		// key was not being passed.
		// signature was:
		// public function __construct($length = null, $defaultValue = null)
		// $this->model was being set via:
		// $tmp =  debug_backtrace();
		// $this->model        = &$tmp[1]['object'];
		
		$this->model        = $object;
		$this->field_type   = 'string';
		$this->defaultValue = $defaultValue;
		$this->length       = ($length) ? $length : 255;
		$this->unique       = $unique;
	}
}
?>
